<% 
	var headContent = {
%>
	<% include("/pages/front/includes/header.html"){} %>

<script type="text/javascript">
<!--
	function delblog(id) {
		var url = 'front/person/delblog/'+id;
		var title = '确认要删除该博文？';
		Confirm(title, function() {
			form1.action = url;
			form1.submit();
		});
	}
//-->
</script>	
<%
};

var bodyContent = {
%>
<%  include("/pages/front/includes/header_menu.html"){} %>	

<div class="container">

	<form name="form1" action=""></form>
	
	<div class="row">
		<div class="col-md-12">	
	
		<div class="panel panel-default">
			 <div class="panel-body" style="padding:0px;">
			<ol class="breadcrumb" style="margin:0px;">
			  <li><a href="1">首页</a></li>
			  <li>我的空间</li>
			</ol>
			</div>
		</div>
	
		</div>
	</div>

	<div class="row">
	<!-- 文章 -->
	<div class="col-md-8">	
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">发布的文章</h3>
		  </div>
		 	 <ul class="list-group">
		 	 	<% 
		 	 		var sessionUserId = isEmpty(session.session_user) ? 0: session.session_user.userid;
		 	 		for(item in page.list){ 
		 	 	%>
		 	 	<li class="list-group-item">
					<div class="row">
					  <div class="col-md-2">
					  	<div class="thumbnail">
					  	  <% if(strutil.isEmpty(item.image_url)) { %>
						  <img src="static/front/images/news.jpg" alt="${item.title}" height="85" 
						  	 style="height: 85px; width: 100%; display: block;" >
					  	  <% } else { %>	
					  	  <% 
						  	var imageUrl = item.image_net_url;
						  	if(strutil.isEmpty(imageUrl)) { 
						  		imageUrl = 'download/image_url/'+item.image_url;
						  	} 
						  	%>
					  	  <img src="${imageUrl}"  alt="${item.title}" height="85"
					  	  	data-holder-rendered="true" style="height: 85px; width: 100%; display: block;">
						  <% } %>
						</div>
					  </div>
					  <div class="col-md-10">
							<h4>
							<a href="front/article/${item.id}" target="_blank" title="${item.title}">
							<% if (strutil.length(item.title) > 18) { %>
								${strutil.subStringTo(item.title, 0, 18)}...
							<% 	} else { %>
								${item.title}
							<%  } %>
							</a>
							<% if(item.sort < 10) { %>
							<span class="label label-primary">置顶</span>
							<% } %>
							<% if(item.is_recommend == 1) { %>
							<span class="label  label-success">推荐</span>
							<% } %> 
								<div class="pull-right" style="font-size:12px;">
								
								<!-- 编辑区 -->
								&nbsp;&nbsp;
								<% if (sessionUserId==item.create_id) { %>
								<span>
								(
									<a href="front/person/editblog/${item.id}" target="_blank"><span>编辑</span></a>
								|
									<a href="javascript:void(0);" onclick="delblog(${item.id});return false;"><span style="color: red;">删除</span></a>
								|
									<a href="front/article/${item.id}.html" target="_blank"><small>查看</small></a>
								)
								</span>
								<% } else { %>
									<a href="front/article/${item.id}.html" target="_blank"><span>查看全部</span></a>
								<% } %>
								</div>
							</h4>
							
							<% var article_content = flyfox.showHTML(item.content!'',100,'  ......'); %>
							<p>
								&nbsp;&nbsp;&nbsp;&nbsp;${article_content!'' }
							</p>
							
							<footer>
								<div class="pull-left" >
									<small>发布时间：${item.publish_time }</small>
								</div>
								<div class="pull-right" >
									<% if(item.is_comment==1){ %>
										<a href="front/article/${item.id}#article_comment"  target="_blank"><small>评论(${flyfox.countComment(item.id)})</small></a>
									&nbsp;
									<% } %>
									<small>浏览量(${flyfox.countView(item.id)})</small>
									&nbsp;
									<% 
										var isLike = (sessionUserId==0? false: flyfox.isLike(sessionUserId,item.id)); 
									%>
									<span style="vertical-align: middle;cursor: pointer;"  id="articlelike_${item.id}" onclick="articlelike.click(${item.id});" 
										class="glyphicon glyphicon-heart${isLike?'':'-empty'}"
										title="${isLike?'取消':''}喜欢" aria-hidden="true"></span>
								</div>
							</footer>
					  </div>
					 </div>
				</li>
				<% } %>
				<li class="list-group-item">
					<%include("/pages/front/includes/paginator.html"){} %>
				</li>
			  </ul>
		</div>

	</div>
	
	<!-- 信息列表 -->
	<div class="col-md-4">	
		<!-- 用户信息 -->
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">用户信息</h3>
		  </div>
		  <div class="panel-body">
			  	<div class="thumbnail">
			      <img id="title_pic" alt="${user.userName }头像"  width="64" height="64" 
							 			class="img_radius" src="${user.title_url!'static/images/user/user.png'}">
			      <div class="caption">
			        <h3>${user.realname!''}</h3>
			        <p>&nbsp;&nbsp;&nbsp;&nbsp;${user.remark!''}</p>
			      </div>
			  	</div>
			  	
			  	<div class="list-group" role="group">
				  <a href="front/person/newblog" class="list-group-item">
				  	<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
				  	发布博文
				  </a>
				  <a href="front/person" class="list-group-item">
				  	<span class="glyphicon glyphicon-book" aria-hidden="true"></span>
				  	<span class="badge">${userarticle!''}</span>
				  	我的博文
				  </a>
				  <a href="front/person/articlelike" class="list-group-item">
				  	<span class="glyphicon glyphicon-heart" aria-hidden="true"></span>
				  	<span class="badge">${userlike!''}</span>
				  	喜欢博文
				  </a>
				  <a href="front/person/profile" class="list-group-item">
				  	<span class="glyphicon glyphicon-heart" aria-hidden="true"></span>
				  	编辑信息
				  </a>
				</div>
		  </div>	 
		</div>
		
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">其他标签<a class="more" href="front/tags/all">更多</a></h3>
		  </div>
		  <div class="panel-body">
			<%  
					if(taglist != null && taglist.~size > 0) {
			%>
				<ul class="q-taglist clearfix">
					<li title="标签"><span class="q-icon"></span></li>
				<%
					for(tagitem in taglist){ 
				%>
					<li class="q-tagitem">
					<a class="a-tagitem" href="front/tags/${tagitem.tagname}">${tagitem.tagname}</a>
					</li>
				<% 
					}
				%>
				</ul>
			<%
			} 
			%>
		 </div>
		</div>
		
		<!-- 推荐文章 -->
		<%  include("/pages/front/includes/recommend.html"){} %>
		
		<!-- 友情链接 -->
		<%  include("/pages/front/includes/friendly.html"){} %>
	</div>
	</div>

</div>
	
<%  include("/pages/front/includes/footer.html"){} %>
	
<a id="scrollTop" href="javacript:void(0);" title="返回顶部" style="display: inline;"></a>
	
<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>

